<?xml version="1.0" encoding="utf-8"?>
<Content xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:blueonionsoftware-com:bloget:runtime:data">
  <text>&lt;p&gt;by Adam Marks&lt;/p&gt;
&lt;p&gt;How To Implement Modal Dialog Boxes and Message Boxes in KinetDx &lt;/p&gt;
&lt;u&gt;
&lt;p&gt;Why?&lt;/p&gt;&lt;/u&gt;
&lt;p&gt;Our standard message boxes are somewhat modal in that they consume mouse clicks and keystrokes, but they are modeless in the sense that they immediately return control to the calling code, before the user chooses an option. There are several reasons why this might be undesirable.&lt;/p&gt;&lt;u&gt;
&lt;p&gt;How to implement a modal message box?&lt;/p&gt;&lt;/u&gt;
&lt;p&gt;To invoke a modal dialog message box with or without options, there are 4 modalmessagebox() functions in RSNTLookAndFeel::UserInterface.&lt;/p&gt;
&lt;p&gt;What's the difference between a modal and modeless message box? When you call a modeless message box, it will immediately return, whereas a modal message box will only return control once the user has chosen an option(and that option's associated code has completed) and/or the dialog has been dismissed.&lt;/p&gt;&lt;u&gt;
&lt;p&gt;How to implement a modal dialog?&lt;/p&gt;&lt;/u&gt;
&lt;p&gt;Create a dialog as usual, but when you make it visible, include a call to &lt;/p&gt;
&lt;p&gt;RSNTLookAndFeel::UserInterface::doModal( MyDialog ).&lt;/p&gt;
&lt;p&gt;For an example, I made the About box in KinetDx a modal dialog, by adding the one line of code in WorkflowRadiology::AboutDialog::showDialog():&lt;/p&gt;
&lt;p&gt;// show this thing&lt;/p&gt;
&lt;p&gt;mAboutDialog.makeVisible();&lt;/p&gt;
&lt;p&gt;// Make it modal&lt;/p&gt;
&lt;p&gt;UserInterface::userInterface().doModal( mAboutDialog );&lt;/p&gt;
&lt;p&gt;The doModal() will "block" the code until the dialog has either been dismissed(via a makeVisible(false) or destroyed via destroyVisualRepresentation() ).&lt;/p&gt;&lt;img src ="http://flounder_aaeng/blogs/devnotes/aggbug/233.aspx" width = "1" height = "1" /&gt;</text>
  <last_update>2007-10-04T00:43:32.5700806Z</last_update>
  <source_title />
  <source_link />
  <comments />
  <references />
  <attachments />
</Content>